package com.example.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.sql.Timestamp;

@Data
public class User implements Serializable {
      /**
       * 主键
       */
      private long id;
      /**
       * 用户名
       */
      private String username;
      /**
       * 用户密码
       */
      private String password;
      /**
       * 真实姓名
       */
      private String actName;
      /**
       * 邮箱
       */
      private String email;
      /**
       * 电话号码
       */
      private String phone;
      /**
       * 角色，枚举  DBA(0)、管理员(1)、普通用户(2)
       */
      private char role;
      /**
       * 账号状态
       */
      private char status;
      /**
       * 创建时间
       */
      @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
      private Timestamp createTime;
      /**
       * 修改时间
       */
      @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
      private Timestamp updateTime;

      public User() {
      }

      public User(long id, String username, String password, String actName, String email, String phone, char role, char status) {
            this.id = id;
            this.username = username;
            this.password = password;
            this.actName = actName;
            this.email = email;
            this.phone = phone;
            this.role = role;
            this.status = status;
      }
}

